﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Register.aspx.cs" Inherits="UCenter.Web.Views.Account.Register" %>
<%@ Import Namespace="UCenter.BusinessContract" %>
<asp:content id="registerContent" contentplaceholderid="MainContent" runat="server">
<script type="text/javascript">
$(document).ready(function(){
	$("#form_register").validate( {
		rules: {
		    Email: {
		        required: true,
		        email: true,
		        remote: '<%=Url.Action("IsEmailAvailable", "Account") %>'
		    },
		    TrueName: {
		        required: true,
		        minlength: 3
		    },
			Password: {
				required: true,
				minlength: 8
			},
			PassConfirm: {
				required: true,
				minlength: 8,
				equalTo: "#Password"
			}
		},
		messages: {
		    Email: {
		        required: "Email地址不能为空",
		        email: "Email地址输入格式不正确",
		        remote: "该Email地址已经被注册，请重新输入"
		    },
		    TrueName: {
		        required: "姓名不能为空",
		        minlength: "姓名长度最少为3个字符"
		    },
		    Password: {
			    required: "密码不能为空",
				minlength: "密码长度最小为8位"
			},
			PassConfirm: {
				required: "确认密码不能为空",
				minlength: "密码长度最小为8位",
				equalTo: "两次输入密码不一致"
			}
		}
	});
});
function changeAccept()
{
    $("#submit_register").attr("disabled", !($("#AcceptLicense").attr("checked")));
}
</script>
<div class="form1">
	<h3>注册</h3>
	<%
        if (ViewData["IsSucess"] != null && (bool)ViewData["IsSucess"] == true)
        {    
    %>
            <div class="message">注册成功，请及时登录您的邮箱进行激活</div>
    <%
        }
        else
        {
    %>
	<form id="form_register" method="post" action="<%= Html.AttributeEncode(Url.Action("Register")) %>">
		<p>
			<label for="email">你的Email：</label>
			<%=Html.TextBox("Email", "", new { @class = "f-text" })%>
			<%=Html.ValidationMessage("Email")%>
		</p>
		<p>
			<label for="truename">姓 名：</label>
			<%=Html.TextBox("TrueName", "", new { @class = "f-text" })%>
			<%=Html.ValidationMessage("TrueName")%>
		</p>
		<p>
			<label for="password">密 码：</label>
			<%=Html.Password("Password", "", new { @class = "f-text" })%>
			<%=Html.ValidationMessage("Password")%>
		</p>
		<p>
			<label for="passconfirm">重复密码：</label>
			<%=Html.Password("PassConfirm", "", new { @class = "f-text" })%>
			<%=Html.ValidationMessage("PassConfirm")%>
		</p>
		<p>
			<label class="f-check"><input type="checkbox" checked="checked" id="AcceptLicense" onclick="changeAccept()" />我已阅读并接受<a href="#TB_inline?height=300&width=600&inlineId=hiddenModalContent&modal=true" class="thickbox">《使用协议》</a></label>
		</p>
		<p><%= Html.SubmitButton("submit_register", "注册", new { @class = "f-button" })%></p>
		<div id="hiddenModalContent" style="display:none;">
            <p>
                如果你想注册成为UCenter.NET用户，请务必阅读本使用协议（以下简称“本协议”）并在注册过程中表明你同意接受本协议。
            </p>
            <p>
                一旦注册成为UCenter.NET用户，即代表你保证：<br/>
                （a）你提交的个人信息是真实、准确、完整的；<br/>
                （b）你会不断更新个人资料，以符合及时、详尽、准确的要求；<br/>
                （c）你在使用服务时不会违反任何适用的国家法律或法规；<br/>
                （d）你在使用服务时不会违反UCenter.NET一切有效的管理办法和规定。
            </p>
            <input type="button" value="关闭" onclick="tb_remove()" class="f-button" />
        </div>
	</form>
	<%
        }
	%>
</div>
</asp:content>
